package org.ilead.iserve.service.impl;

import java.util.List;

import org.ilead.iserve.dao.IHelpInformationDAO;
import org.ilead.iserve.model.HelpInformation;
import org.ilead.iserve.service.IHelpInformationService;

public class HelpInformationService implements IHelpInformationService {
	private IHelpInformationDAO helpInformationDAO = null;

	public void setHelpInformationDAO(IHelpInformationDAO helpInformationDAO) {
		this.helpInformationDAO = helpInformationDAO;
	}

	@Override
	public void save(HelpInformation helpInformation) throws Exception {
		helpInformationDAO.attachDirty(helpInformation);
	}

	@Override
	public void update(HelpInformation helpInformation) throws Exception {
		helpInformationDAO.update(helpInformation);

	}

	@Override
	public void delete(Long id) throws Exception {
		helpInformationDAO.delete(findById(id));

	}

	@Override
	public List<HelpInformation> findAll() {
		return helpInformationDAO.findAll();
	}

	@Override
	public List<HelpInformation> findByUserId(String userId) {
		return helpInformationDAO.findByUserId(userId);
	}

	@Override
	public HelpInformation findById(Long id) {
		return helpInformationDAO.findById(id);
	}

}
